home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / pyshared / computerjanitorapp / ui_tests.py < prev    next >
Encoding:
Python Source  |  2009-03-04  |  1.2 KB  |  37 lines

  1. # ui_tests.py - unit tests for ui.py
  2. # Copyright (C) 2008, 2009  Canonical, Ltd.
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, version 3 of the License.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  15.  
  16.  
  17. import unittest
  18.  
  19. import computerjanitor
  20. import computerjanitorapp
  21.  
  22.  
  23. class UserInterfaceTests(unittest.TestCase):
  24.  
  25.     def setUp(self):
  26.         self.ui = computerjanitorapp.UserInterface("app", "pm")
  27.         
  28.     def testReturnsCorrectApp(self):
  29.         self.assertEqual(self.ui.app, "app")
  30.     
  31.     def testReturnsCorrectPluginManager(self):
  32.         self.assertEqual(self.ui.pm, "pm")
  33.     
  34.     def testRunRaisesUnimplemented(self):
  35.         self.assertRaises(computerjanitor.UnimplementedMethod, 
  36.                           self.ui.run, None, None)
  37.